{// 引入标签库 }

<tagLib name="html" />
<include file="Public:header" />
<load href='__TMPL__Common/js/jquery.bgiframe.js' />
<load href='__TMPL__Common/js/jquery.weebox.js' />
<load href='__TMPL__Common/js/user.js' />
<load href='__TMPL__Common/style/weebox.css' />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />

<php>
	function get_user_group($group_id)
	{
		$group_name = M("UserGroup")->where("id=".$group_id)->getField("name");
		if($group_name)
		{
			return $group_name;
		}
		else
		{
			return l("NO_GROUP");
		}
	}
	function get_user_level($id)
	{
		$level_name = M("UserLevel")->where("id=".$id)->getField("name");
		if($level_name)
		{
			return $level_name;
		}
		else
		{
			return "没有等级";
		}
	}
	function get_referrals_name($user_id)
	{
		$user_name = M("User")->where("id=".$user_id)->getField("user_name");
		if($user_name)
		return $user_name;
		else
		return l("NO_REFERRALS");
	}
	function f_to_date($date){
		return to_date($date,"Y-m-d H:i");
	}
	function lock_money_func($money,$id){
		return "<a href='javascript:eidt_lock_money(".$id.");'>".format_price($money)."</a>";
	}
	
	function ips_status($ips_acct_no){
		if($ips_acct_no==""){
			return "未同步";
		}
		else{
			return "已同步";
		}
	}
</php>
<div class="main">
<div class="main_title">{$main_title}</div>
<div class="blank5"></div>
<div class="button_row">
	<input type="button" class="button" value="{%ADD}" onclick="add();" />
	<input type="button" class="button" value="{%DEL}" onclick="del();" />
</div>

<div class="blank5"></div>
<div class="search_row">
	<form name="search" action="__APP__" method="get">	
		{%USER_NAME}：<input type="text" class="textbox" name="user_name" value="{:trim($_REQUEST['user_name'])}" style="width:100px;" />
		{%USER_EMAIL}：<input type="text" class="textbox" name="email" value="{:trim($_REQUEST['email'])}" style="width:100px;" />
		{%USER_MOBILE}：<input type="text" class="textbox" name="mobile" value="{:trim($_REQUEST['mobile'])}" style="width:100px;" />
		{%REFERRALS_NAME}：<input type="text" class="textbox" name="pid_name" value="{:trim($_REQUEST['pid_name'])}" style="width:100px;" />
		{%USER_GROUP}: 
		<select name="group_id">
				<option value="0" <if condition="intval($_REQUEST['group_id']) eq 0">selected="selected"</if>>{%ALL}</option>
				<foreach name="group_list" item="group_item">
					<option value="{$group_item.id}" <if condition="intval($_REQUEST['group_id']) eq $group_item['id']">selected="selected"</if>>{$group_item.name}</option>
				</foreach>
		</select>
		<select name="is_effect">
				<option value="-1" <if condition="$_REQUEST['is_effect'] eq -1 || $_REQUEST['is_effect'] eq ''">selected="selected"</if>>{%ALL}</option>
				<option value="1" <if condition="intval($_REQUEST['is_effect']) eq 1">selected="selected"</if>>有效</option>
				<option value="0" <if condition="intval($_REQUEST['is_effect']) eq 0 && isset($_REQUEST['is_effect'])">selected="selected"</if>>无效</option>
				
		</select><br>
		注册时间：
		<input type="text" class="textbox" name="begin_time" id="begin_time" value="{:trim($_REQUEST['begin_time'])}" onfocus="return showCalendar('begin_time', '%Y-%m-%d %H:%M:%S', false, false, 'btn_begin_time');" />
		<input type="button" class="button" id="btn_begin_time" value="{%SELECT_TIME}" onclick="return showCalendar('begin_time', '%Y-%m-%d %H:%M:%S', false, false, 'btn_begin_time');" />	
		-
		<input type="text" class="textbox" name="end_time" id="end_time" value="{:trim($_REQUEST['end_time'])}" onfocus="return showCalendar('end_time', '%Y-%m-%d %H:%M:%S', false, false, 'btn_end_time');" />
		<input type="button" class="button" id="btn_end_time" value="{%SELECT_TIME}" onclick="return showCalendar('end_time', '%Y-%m-%d %H:%M:%S', false, false, 'btn_end_time');" />	
		
		
		<input type="hidden" value="User" name="m" />
		<input type="hidden" value="index" name="a" />
		<input type="submit" class="button" value="{%SEARCH}" />
    	<input type="button" class="button" value="{%EXPORT}" onclick="export_csv();" />
	</form>
</div>
<div class="blank5"></div>
<html:list 
	id="dataTable" 
	style="dataTable" 
	name="user" 
	checkbox="true" 
	action="true" 
	datasource="list" 
	show="id:{%ID}|50px,user_name:{%USER_NAME}:edit,email:{%USER_EMAIL},mobile:{%USER_MOBILE},money|format_price:{%USER_MONEY},lock_money|lock_money_func=$user['id']:{%USER_LOCK_MONEY},point:信用,level_id|get_user_level:会员等级,pid|get_referrals_name:{%REFERRALS_USER},login_ip:{%LOGIN_IP},login_time|f_to_date:{%LOGIN_TIME},create_time|f_to_date:注册时间,is_effect|get_is_effect=$user['id']:{%IS_EFFECT},ips_acct_no|ips_status:同步到第三方" 
	actionlist="edit:{%EDIT}, del:{%DEL},user_work:{%USER_WORK_SHORT}, account:{%USER_ACCOUNT_SHORT},user_passed:{%USER_PASSED_SHORT},account_detail:{%USER_ACCOUNT_DETAIL_SHORT},info_down:资料,view_info:资料展示,bank_manage:银行卡管理,load_manage:投标记录"/> 

<div class="blank5"></div>
<div class="page">{$page}</div>
</div>
<include file="Public:footer" />